package operation.android.util;

/**
 * 项目文件路径统一管理
 */
public class OutFilePath {
    /**
     * 模板生成路径 MES为例
     */
    // 默认模板输入路径
    static String toPath = "D:\\workspace\\abandon-me\\server\\src\\main\\java\\operation\\android\\out\\";
    // Activity
    static String activityPath = "2.src\\trunk\\2.Application\\Android\\app\\src\\main\\java\\cn\\eoneplus\\mes\\ui\\module\\verification\\";
    // XML
    static String activity_path = "2.src\\trunk\\2.Application\\Android\\app\\src\\main\\res\\layout\\";
    /**
     * 文件修改路径 MES为例
     */
    // 测试文件路径
    static String testUrl = "D:\\workspace\\abandon-me\\server\\src\\main\\java\\operation\\android\\out\\updateTest.java";
    // AppViewModelFactory
    static String appViewModelFactoryUrl = "2.src\\trunk\\2.Application\\Android\\app\\src\\main\\java\\cn\\eoneplus\\mes\\app\\AppViewModelFactory.java";
    // VerificationViewModel
    static String verificationViewModelUrl = "2.src\\trunk\\2.Application\\Android\\app\\src\\main\\java\\cn\\eoneplus\\mes\\ui\\module\\verification\\VerificationViewModel.java";
    // AndroidManifest
    static String androidManifestUrl = "2.src\\trunk\\2.Application\\Android\\app\\src\\main\\AndroidManifest.xml";
    // EntityConstant
    static String entityConstantUrl = "2.src\\trunk\\2.Application\\Android\\app\\src\\main\\java\\cn\\eoneplus\\mes\\constant\\EntityConstant.java";


    /**
     * android项目路径
     */
    public String androidProjectPath = "C:\\Users\\86132\\Desktop\\svn\\OneMES\\";  // 默认路径
    public final String UI_PATH = "2.src\\\\trunk\\\\2.Application\\\\Android\\\\app\\src\\\\main\\\\java\\\\cn\\\\eoneplus\\\\mes\\\\ui\\\\module\\\\verification\\\\";

    public String getAndroidProjectPath() {
        return androidProjectPath;
    }

    public void setAndroidProjectPath(String androidProjectPath) {
        this.androidProjectPath = androidProjectPath;
    }

    public String getAndroidOutPath() {
        if (androidProjectPath.equals("C:\\Users\\86132\\Desktop\\svn\\OneMES\\")) {
            return androidProjectPath;
        } else {
            return convertPath(androidProjectPath);
        }
    }

    public void setAndroidOutPath(String androidProjectPath) {
        this.androidProjectPath = androidProjectPath;
    }


    /**
     * 路径转换方法 e.g.
     * "C:\Users\86132\Documents\Fax"
     * "D:\\workspace\\onego\\src\\main\\java\\com\\example\\onego\\android\\out\\"
     */
    public static String convertPath(String path) {
        String re = java.util.regex.Matcher.quoteReplacement("\\");
        String path1 = path + "\\";
        String path2 = path1.replace("\\", "\\\\");
        return path2;
    }

    public String getUiPath() {
        return UI_PATH;
    }
}
